package com.love.common.feign.user.impl;

import com.love.common.feign.user.UserFeign;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * TODO description
 *
 * @author sunbo
 * @date 2021/5/11 下午2:25
 */
@Component
public class UserFeignFallbackFactory implements FallbackFactory<UserFeign> {

    @Override
    public UserFeign create(Throwable throwable) {
        return new UserFeign() {
            @Override
            public String test(String name) {
                return "系统异常，稍后再试！";
            }

            @Override
            public String info(String id) {
                return null;
            }
        };
    }
}
